(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define(['lib/backbone_setup', 'chaplin', 'layout', 'dispatcher', 'router', 'lib/feedback', 'lib/underscore_mixins', 'lib/validate_setup', 'lib/mask_setup'], function() {
    'use strict';
    var Application, Chaplin, Dispatcher, Layout, Router, ajaxSetup, _ref;
    Chaplin = require('chaplin');
    Layout = require('layout');
    Dispatcher = require('dispatcher');
    Router = require('router');
    ajaxSetup = require('lib/ajax_setup');
    return Application = (function(_super) {
      __extends(Application, _super);

      function Application() {
        _ref = Application.__super__.constructor.apply(this, arguments);
        return _ref;
      }

      Application.prototype.title = 'Banklion';

      Application.prototype.initialize = function() {
        Application.__super__.initialize.apply(this, arguments);
        return this.subscribeEvent('router:match', function() {
          return this.publishEvent('menu:updateActive');
        });
      };

      Application.prototype.initLayout = function(options) {
        if (options == null) {
          options = {};
        }
        if (options.title == null) {
          options.title = this.title;
        }
        return this.layout = new Layout(options);
      };

      Application.prototype.initDispatcher = function(options) {
        return this.dispatcher = new Dispatcher(options);
      };

      Application.prototype.initRouter = function(routes, options) {
        this.router = new Router(options);
        return typeof routes === "function" ? routes(this.router.match) : void 0;
      };

      return Application;

    })(Chaplin.Application);
  });

}).call(this);
